<template>
	<view class="add-button" @click="handleClick">
		<uni-icons type="plusempty" size="23"></uni-icons>
		<text>{{props.txt}}</text>
	</view>
</template>

<script lang="ts" setup>
import { defineProps, withDefaults, defineEmits } from 'vue';


interface Props {
	txt: string

}

const props = withDefaults(defineProps<Props>(), {
	txt: "添加",
})

const emit = defineEmits<{
	(e: "click"): void
}>()

function handleClick() {
	emit("click");
}
</script>

<style lang="scss" scoped>
.add-button {
	padding: 6rpx 10rpx;
	width: fit-content;
	
	border: 1px solid $uni-theme-color;
	display: flex;
	align-items: center;
	border-radius: 10rpx;
	
	text {
		margin: 0 6rpx;
	}
}

.add-button:active {
	
	color: #fff;
	background: $uni-theme-color;
}
</style>